package edu.upc.dew.dto;

import java.io.Serializable;

public class FormResponse implements Serializable {

    private static final long serialVersionUID = 1L;
    private boolean success;
    private String message;
    private Object data;
    private boolean invalidKeycode;

    public FormResponse() {
    }

    public FormResponse(boolean success, String message) {
        this.success = success;
        this.message = message;
    }

    public FormResponse(boolean success, String message,  boolean invalidKeycode) {
        this.success = success;
        this.message = message;
        this.invalidKeycode = invalidKeycode;
    }

    public FormResponse(boolean success, String message, Object data, boolean invalidKeycode) {
        this.success = success;
        this.message = message;
        this.data = data;
        this.invalidKeycode = invalidKeycode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public boolean isInvalidKeycode() {
        return invalidKeycode;
    }

    public void setInvalidKeycode(boolean invalidKeycode) {
        this.invalidKeycode = invalidKeycode;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "FormResponse{" + "success=" + success + ", msg=" + message + ", data=" + data + ", sessionExpired=" + invalidKeycode + '}';
    }

}
